package com.alex.jbpm.apply.task;

import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.exe.ExecutionContext;
import org.jbpm.taskmgmt.def.AssignmentHandler;
import org.jbpm.taskmgmt.exe.Assignable;

public class CountyProcessTask implements AssignmentHandler {

	private static final long serialVersionUID = 1575730952153658545L;

	public void assign(Assignable assign, ExecutionContext context) throws Exception {
		ContextInstance contextInstance = context.getContextInstance();
		
		//获取申请单对应的行政区划信息，并根据行政区划设置操作用户级别
		String actorLevel = contextInstance.getVariable("actorLevel").toString();
		assign.setActorId(actorLevel);
		
		
		System.out.println("进行公文：".concat(contextInstance.getVariable("documentId").toString()).concat(actorLevel).concat(" 任务分配..."));
	}

}
